package com.gettec.lims.client.window;


 
import java.util.ArrayList;
import java.util.List;

import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.layout.FlowData;
import com.extjs.gxt.ui.client.widget.menu.Menu;
import com.extjs.gxt.ui.client.widget.menu.MenuBar;
import com.extjs.gxt.ui.client.widget.menu.MenuBarItem;
import com.extjs.gxt.ui.client.widget.menu.MenuItem;
import com.gettec.lims.client.forms.SampleInfoForm;
import com.gettec.lims.client.grid.SampleInfoGridView;
import com.gettec.lims.client.menu.MenuItemEx;
import com.gettec.lims.shared.model.SampleInfo;
import com.google.gwt.user.client.Element;
  
public class SampleInfoWindow extends Window {  
  
    private final SampleInfoForm siForm = new SampleInfoForm();  
    private final SampleInfoGridView sivie = new SampleInfoGridView();  
    public SampleInfoWindow(){}
    public SampleInfoWindow(final SampleInfo sf) {  
        setHeading("样品登记单");  
        setAutoWidth(true);
 
        final Button btnSave = new Button("保存");  
        btnSave.setIconStyle("save");  
        btnSave.addSelectionListener(new SelectionListener<ButtonEvent>() {  
            public void componentSelected(ButtonEvent ce) {  
                btnSave.setEnabled(false);  
               /* if (siForm.isValid()) {  
                    hide(btnSave);  
                    siForm.save(sf);  
                } else {  
                    btnSave.setEnabled(true);  
                }  */
            }  
        });  
        addButton(btnSave);  
    }  
  
    @Override  
    protected void onRender(Element parent, int pos) {  
    	 

        
       // add(siForm);
    }  
    private void menuListener(List<MenuItem> l)
    {
    	for (int i = 0; i < l.size(); i++) {
    		MenuItem it=l.get(i);
    		//it.addListener(, listener)
		}
    }
    
}  
